import Request from "./request";

//获取登录接口
export function getLogin(phone, password, captcha) {
  return Request({
    url: "/login/cellphone",
    params: {
      phone,
      password,
      captcha,
    },
  });
}

//获取验证码
export function getCaptcha(phone) {
  return Request({
    url: "/captcha/sent",
    params: {
      phone,
    },
  });
}

//获取key
export function getQrcodeKey() {
  return Request({
    url: "/login/qr/key",
    params: {},
  });
}
//生成二维码
export function getQrcodeImg(key) {
  return Request({
    url: "/login/qr/create",
    params: { key },
  });
}

//检测二维码状态
export function getQrcodeCheck(key) {
  return Request({
    url: "/login/qr/check",
    params: { key },
  });
}

//通过cookie获取用户信息
export function getUserInfoByck() {
  return Request({
    url: "/user/account",
    params: {},
  });
}
